package com.mxx.v3.web.controller;
import com.github.pagehelper.PageInfo;
import com.mxx.v3.service.QualityMouthQualifiedService;

import com.mxx.v3.support.RestResponse;
import com.mxx.v3.utils.PageDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.mxx.v3.web.query.QualityMouthQualifiedQuery;
import com.mxx.v3.pojo.TQualityMouthQualified;
import com.mxx.v3.utils.PageQuery;

@RestController
@RequestMapping("/qualitymouthqualified")
public class QualityMouthQualifiedController {
    @Autowired
    private QualityMouthQualifiedService qualityMouthQualifiedService;
    @GetMapping("/list")
    public RestResponse getList(Integer page, Integer limit, QualityMouthQualifiedQuery qualityMouthQualifiedQuery){
        PageQuery<QualityMouthQualifiedQuery> QualityMouthQualifiedPageQuery=new PageQuery<>();
        QualityMouthQualifiedPageQuery.setLimit(limit);
        QualityMouthQualifiedPageQuery.setPage(page);
        QualityMouthQualifiedPageQuery.setQueryItem(qualityMouthQualifiedQuery);
        //查询除数据
        PageInfo<TQualityMouthQualified> pageInfo=qualityMouthQualifiedService.getData(QualityMouthQualifiedPageQuery);
        PageDto<TQualityMouthQualified> data= new PageDto<>(pageInfo.getTotal(), pageInfo.getList());
        return new RestResponse(data);
       // return null;
    }
}
